<?php

namespace Database\Factories;

use App\Models\Order;
use App\Models\OrderLog;
use Illuminate\Database\Eloquent\Factories\Factory;

class OrderLogFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = OrderLog::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'order_id' => $this->faker->randomElement(Order::pluck('id')),
            'change_type' => $this->faker->randomElement([
                'cache_key_create_order',
                'pay_success',
                'integral_back',
                'take_delivery',
                'delivery_goods',
                'refund_price'
            ]),
            'change_message' => $this->faker->realTextBetween(5, 10),
        ];
    }
}
